- Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy path609. Find Duplicate File in System_test.go
47 lines (37 loc) · 1 KB
/
609. Find Duplicate File in System_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package leetcode
import (
"fmt"
"testing"
)
typequestion609struct {
para609
ans609
}
// para 是参数
// one 代表第一个参数
typepara609struct {
paths []string
}
// ans 是答案
// one 代表第一个答案
typeans609struct {
one [][]string
}
funcTest_Problem609(t*testing.T) {
qs:= []question609{
{
para609{[]string{"root/a 1.txt(abcd) 2.txt(efgh)", "root/c 3.txt(abcd)", "root/c/d 4.txt(efgh)", "root 4.txt(efgh)"}},
ans609{[][]string{{"root/a/2.txt", "root/c/d/4.txt", "root/4.txt"}, {"root/a/1.txt", "root/c/3.txt"}}},
},
{
para609{[]string{"root/a 1.txt(abcd) 2.txt(efgh)", "root/c 3.txt(abcd)", "root/c/d 4.txt(efgh)"}},
ans609{[][]string{{"root/a/2.txt", "root/c/d/4.txt"}, {"root/a/1.txt", "root/c/3.txt"}}},
},
}
fmt.Printf("------------------------Leetcode Problem 609------------------------\n")
for_, q:=rangeqs {
_, p:=q.ans609, q.para609
fmt.Printf("【input】:%v 【output】:%v\n", p, findDuplicate(p.paths))
}
fmt.Printf("\n\n\n")
}